Skip to content

⚡️ Golf cbrt by using a small table for an even better initial estimate and removing another iteration#1523

Merged
atarpara merged 2 commits into
Vectorized:clzfrom
duncancmt:dcmt/golf-roots
May 13, 2026
Merged

⚡️ Golf cbrt by using a small table for an even better initial estimate and removing another iteration#1523
atarpara merged 2 commits into
Vectorized:clzfrom
duncancmt:dcmt/golf-roots

Conversation

@duncancmt

@duncancmt duncancmt commented May 12, 2026

Copy link
Copy Markdown
Contributor

Description

Following on #1515, improve the implementation of cbrt by using a small lookup table to seed the initial estimate based on the input octave. This allows us to remove 1 additional Newton-Raphson iteration, going down to 5.

This PR was initially authored by AI (codex and claude) and then reviewed, validated, and cleaned up by a human (me). The formal proof of correctness was fully AI-authored.

Checklist

  • Ran forge fmt?
  • Ran forge test?

@atarpara atarpara merged commit 7d30d53 into Vectorized:clz May 13, 2026
atarpara pushed a commit that referenced this pull request May 13, 2026
…mate and removing another iteration (#1523)

* ⚡️ Golf `cbrt` by using a small table for an even better initial estimate and removing another iteration

* Formatting
atarpara added a commit that referenced this pull request May 13, 2026
* rebase with origin/main

* T

* Added test

* T

* T

* ⚡️ Golf `sqrt` and `cbrt` by getting a better initial estimate and removing an iteration (#1515)

* ⚡️Golf `sqrt` and `cbrt` by getting a better initial estimate and removing an iteration

* ⚡️Golf `cbrt` a little bit more by cutting corners during initialization

* ⚡️ Golf `cbrt` by using a small table for an even better initial estimate and removing another iteration (#1523)

* ⚡️ Golf `cbrt` by using a small table for an even better initial estimate and removing another iteration

* Formatting

* T

---------

Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants